/*
 * Copyright (c) 2006, 2022, webrx.cn All rights reserved.
 *
 */
package cn.webrx.config;

import com.alibaba.druid.pool.DruidDataSource;
import org.springframework.context.annotation.*;

import javax.sql.DataSource;
import java.util.Date;

/**
 * <p>Project: spring2022 - AppConfig
 * <p>Powered by webrx On 2022-03-16 16:48:30
 * <p>Created by IntelliJ IDEA
 *
 * @author webrx [webrx@126.com]
 * @version 1.0
 * @since 17
 */

@Configuration @ComponentScan("cn.webrx.config")
public class AppConfig {


    @Bean(name = "userdate") @Scope("prototype")
    public Date ud(){
        return new Date();
    }

    @Bean
    public DataSource dateSource(){
        DruidDataSource ds = new DruidDataSource();
        ds.setUsername("root");
        ds.setUrl("jdbc:mysql:/db");
        ds.setDriverClassName("com.mysql.cj.jdbc.Driver");
        return ds;
    }
}
